home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _WordDocFindReplace.au3 < prev    next >
Text File  |  2007-09-08  |  575b  |  15 lines

  1. ; *******************************************************
  2. ; Example 1 - Create a word window, open a document, find "this", 
  3. ;                replace all occurrences with "THIS", quit without saving changes.
  4. ; *******************************************************
  5. ;
  6. #include <Word.au3>
  7. $oWordApp = _WordCreate (@ScriptDir & "\Test.doc")
  8. $oDoc = _WordDocGetCollection($oWordApp, 0)
  9. $oFind = _WordDocFindReplace($oDoc, "this", "THIS")
  10. If $oFind Then
  11.     MsgBox(0, "FindReplace", "Found and replaced.")
  12. Else
  13.     MsgBox(0, "FindReplace", "Not Found")
  14. EndIf
  15. _WordQuit ($oWordApp, 0)